/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ordenacao;

public class InsertionSort {

    public static void InsertionSort(Object [] objetos, int tam) {
        int i, j;
        Object aux[] = null;
        for (i = 1; i < tam; i++) {

            j = i;
            while ((j != 0) && (objetos.toString().charAt(i) < objetos.toString().charAt(j - 1))) {

                aux[i] = objetos[j];
                objetos[j] = objetos[j - 1];
                objetos[j - 1] = aux[i];
                j--;
            }
        }

    }
}
